package com.bcht.demo.spring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
public class IndexController {

    @RequestMapping("freemarker/index")
    public String index(ModelMap map){
        map.put("name","James");
        map.put("sex",1);
        List<String> userList = new ArrayList<>();
        userList.add("张三");
        userList.add("李四");
        map.put("userList",userList);
        return "index";
    }
}
